package com.synjones.zeus.model.face;

/**
 * 人脸照片注册失败原因
 * Created by liubinqiang on 2018/5/2.
 */
public enum FacePicRegFaildStatus {


    SUCCESS("0", "成功"),
    HAS_N0_INIT_FACESDK("1", "终端处理异常"),
    HAS_NO_FACE("2", "未检测到人脸"),
    HAS_SUNGLASSES("3", "类似太阳镜遮挡"),
    HAS_MASK("4", "类似面具遮挡"),
    BLURSCORE("5", "照片模糊"),
    PTSCORE("6", "人脸关键点可信度超限"),
    SCORE("7", "人脸置信度超限"),
    DISTANCE("8", "两眼间距离超限"),
    ROLL("9", "歪头偏转角超限"),
    YAW("10", "左右摇头偏转角超限"),
    PITCH("11", "上下点头偏转角超限"),
    DISCERNERROR("99", "不是我");


    private final String code;// 状态码
    private final String desc;// 状态码描述

    FacePicRegFaildStatus(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String code() {
        return code;
    }

    public String desc() {
        return desc;
    }

    /**
     * *
     * 根据code获取描述
     *
     * @param code
     * @return
     */
    public static String getDesc(String code) {

        for (FacePicRegFaildStatus info : FacePicRegFaildStatus.values()) {
            if (code != null && code.equals(info.code)) {
                return info.desc;
            }
        }
        return code;
    }
}
